package com.gym.demo;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;

public class IoText2 {
	public static void main(String[] args) throws Exception {
		File file = new File("d:/Text");
		if(!file.exists()){
			file.mkdirs();
		}
		File file1 = new File("D:\\guan.txt");
		File file2 = new File("d:/Text/guan.txt");
		FileReader fReader = new FileReader(file1);
		FileWriter fileWriter = new FileWriter(file2);
		BufferedReader bf = new BufferedReader(fReader);
		BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
		String string ="";
		while ((string =bf.readLine())!=null) {
			bufferedWriter.write(string);
			bufferedWriter.newLine();
		}
		bufferedWriter.close();
		bf.close();
		fileWriter.close();
		fReader.close();
	}
}
